' BASIC Anywhere Machine program by Charlie Veniot
' Trigonometric functions by Hamid Naderi Yeganeh for "12,000 CIRCLES" at https://blogs.scientificamerican.com/guest-blog/making-mathematical-art/
pi = 3.1415929
screen _newimage(2500, 2200, 21)
for k = 1 to 12000
x = int ( cos(14 * pi * k / 12000) * ( 1 - ( 3 / 4 ) * (cos(32 * pi * k / 12000))^2 ) * 1000 )
y = int ( sin(14 * pi * k / 12000) * ( 1 - ( 3 / 4 ) * (cos(32 * pi * k / 12000))^2 ) * 1000 )
r = int ( ( 1 / 200 + 1 / 10 * (sin(56 * pi * k / 12000))^4 ) * 1000 )
' print x, y, r
if r > 70 then
c = &hfBf3E6
elseif r < 70 and r > 10 then
c = &hb8bc86 + (r mod 500)
else
c = &hFFD700
end if
circle (x+1200,y+1100), r, c
next k